<%@page pageEncoding="utf-8" contentType="text/html; charset=utf-8" %>
<%@ include file="/admin/include/init_admin.jsp" %>
<%@ page import="com.joinhawaii.admin.product.*" %>
<%

	HashList code123	= CommonUtil.getCodeList("123");	//섬
	HashList code005	= CommonUtil.getCodeList("005");	//항공사
	HashList code122	= CommonUtil.getCodeList("122");	//편도구분


	String job_type		= StringUtil.nvl(request.getParameter("job_type"),"U");
	String fly_id		= StringUtil.nvl(request.getParameter("fly_id"));


	HashMap infos = new HashMap();
	infos.put("fly_id",	fly_id);

	ProductDAO dao 		= new ProductDAO();
	HashList list 		= dao.selectFlyList(infos);


%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<title>조인하와이</title>
	<%@ include file="/admin/include/cssnjs.jsp"  %>
	<script type="text/javascript" src="/js/ajaxfileupload.js"></script>
	<script type="text/javascript" src="/SE2.3.1.O9858/js/HuskyEZCreator.js" charset="utf-8"></script>

	<script type="text/javascript">
	var oEditors = [];

	$(document).ready(function() {

		cfInitSE("fly_notice");

		/* 탭 클릭 */
		$('li', '#tabs').click(function(){
		    $('.on', '#tabs').removeClass('on').addClass('off');
		    $(this).addClass('on');

			$('#tabs-1:not(.hidden),#tabs-2:not(.hidden),#tabs-3:not(.hidden)').addClass('hidden');
			$('#tabs-'+$(this).attr('code')).removeClass('hidden');
		});


	});


	function fnSave() {

		if (confirm(MSG_<%=job_type%>)) {
			oEditors.getById["fly_notice"].exec("UPDATE_CONTENTS_FIELD", []);
			$('#saveForm').attr('action', './flySave.do');
			$('#saveForm').submit();
		}
	}

	function fnDelete() {
		if (confirm(MSG_D)) {
			$('#job_type').val('D');
			$('#saveForm').attr('action', './flySave.do');
			$('#saveForm').submit();
		}
	}

	</script>
</head>
<body>
<div id="wrap">
	<div id="top">
		<%@ include file="/admin/include/top.jsp" %>
	</div>
	<div id="page">
		<div id="menu">
			<%@ include file="/admin/include/leftMenu.jsp" %>
		</div>
		<div id="contents">
			<div class="menu_title">
				<h1>할인항공</h1>
				<p>관리자 > 상품관리 > <b>할인항공</b></p>
			</div>
			<div class="clear line_01"></div>



			<ul id="tabs" class="tab_01 mt15">
			    <li class="on"  code="1"><p>1. 기본사항</p></li>
			</ul>


			<div id="tabs-1" class="mt15">

				<form id="saveForm" method="post" action="">
				<input type="hidden" name="job_type" id="job_type" value="<%= job_type %>"/>
				<input type="hidden" name="fly_id" value="<%= list.get("fly_id", 0) %>"/>

				<table cellpadding="0" cellspacing="0" class="table_01 mt5">
				<colgroup>
					<col width="100px"/>
					<col width="280px"/>
					<col width="100px"/>
					<col/>
				</colgroup>
				<tbody>
					<tr>
						<th><p>항공사</p></th>
						<td>
							<select name="air_code" class="w120">
							<%= StringUtil.makeOption(code005, list.get("air_code", 0)) %>
						  	</select>
						</td>
						<th><p>편도구분</p></th>
						<td class="brx">
							<%= StringUtil.makeRadio(code122, "fly_type", list.get("fly_type", 0)) %>
						</td>
					</tr>
					<tr>
						<th><p>출발지</p></th>
						<td>
							<select name="from_land_code">
							<%= StringUtil.makeOption(code123, list.get("from_land_code", 0)) %>
							</select>
						</td>
						<th><p>여행지</p></th>
						<td class="brx">
							<select name="to_land_code">
							<%= StringUtil.makeOption(code123, list.get("to_land_code", 0)) %>
							</select>
						</td>
					</tr>
					<tr>
						<th><p>항공료</p></th>
						<td>
							<input type="text" name="sales_price" id="sales_price" class="w90 r" value="<%= list.get("sales_price", 0) %>" />
						</td>
						<th><p>소요시간</p></th>
						<td class="brx">
							<input type="text" name="take_time" id="take_time" class="wmax" value="<%= list.get("take_time", 0) %>" />
						</td>
					</tr>
					<tr>
						<th><p>규정</p></th>
						<td colspan="3" class="brx">
							<textarea name="fly_notice" id="fly_notice" style="width:860px; height:200px"><%= list.get("fly_notice", 0) %></textarea>
						</td>
					</tr>
				</tbody>
				</table>

				<div class="mt20 mb10 c">
					<a href="./flyList.jsp"><img src="/images/admin/btn_list.gif"/></a>
			<%	if ("U".equals(job_type)) { %>
					<a href="#nohref" onclick="fnSave()"><img src="/images/admin/btn_update.gif" /></a>
					<a href="#nohref" onclick="fnDelete()"><img src="/images/admin/btn_delete.gif" /></a>
			<%	} else if ("C".equals(job_type)) { %>
					<a href="#nohref" onclick="fnSave()"><img src="/images/admin/btn_register.gif" /></a>
			<%	} %>
				</div>

				</form>

			</div>








		</div>
	</div>
</div>

</body>
</html>
